﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class ComAddWant : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (null == Session["com"])
        {
            Label1.Text = "<script>alert('请登录！');window.location.href='ComDefault.aspx';</script>";

        }
    }
    protected void FormView2_ItemInserted(object sender, FormViewInsertedEventArgs e)
    {
        Response.Redirect("ComAddWant.aspx");
    }
    protected void FormView1_ItemDeleting(object sender, FormViewDeleteEventArgs e)
    {
        int cwid = Convert.ToInt32(FormView1.DataKey["cwid"].ToString());
        Boolean flag = new get().jobapplyinfo(cwid);
        if (flag == true)
        {
            new get().deleteapply(cwid);
        }
        SqlDataSource1.DeleteCommand = "delete from tb_comwant where cwid="+cwid+"";

    }
}
